﻿
@{
    ViewBag.Title = "手术资料";
}

@using PagedList
@using PagedList.Mvc
@model PagedList.IPagedList<Yitu.Models.Article.Article>

<div class="pageheader">
    <h2><i class="fa fa-book"></i> 手术资料 </h2>
    <div class="breadcrumb-wrapper">
        <div class="btn-demo">
            <a class="btn btn-success" href="@Url.Action("Create","Article")">添加手术资料</a>
        </div>
    </div>
</div>

<div class="contentpanel">
    <div class="row">
        <div class="table-responsive">
            <table class="table table-hidaction table-hover">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>标题</th>
                        <th>类型</th>
                        <th>手术医生</th>
                        <th>学习次数</th>
                        <th>创建日期</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td>@item.ID</td>
                            <td>@item.Title</td>
                            <td>@(item.Type == 1 ? "名家手术视频" : item.Type == 2 ? "手术规范学习" : "名家谈手术")</td>
                            <td>@item.Auth</td>
                            <td>@item.WatchCount</td>
                            <td>@item.CreatedTime.ToShortDateString()</td>
                            <td><a href="@Url.Action("Edit", "Article", new {aid=item.ID })"><i class="fa fa-edit"></i> <span>编辑</span></a></td>
                        </tr>
                    }
                </tbody>
            </table>
        </div><!-- table-responsive -->
        @Html.PagedListPager((PagedList.IPagedList)Model, page => Url.Action("Index", new
                           {
                               page,
                               adName = ViewBag.AdName
                           })
                            , PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(
                            new PagedListRenderOptions()
                            {
                                LinkToPreviousPageFormat = "上一页",
                                LinkToNextPageFormat = "下一页",
                                MaximumPageNumbersToDisplay = 5
                            }, new AjaxOptions()
                            {
                                HttpMethod = "GET"
                            }))
    </div><!-- row -->
</div>